package com.zatech.cgnci.project.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zatech.cgnci.project.base.context.UserContext;
import com.zatech.cgnci.project.dto.CgnciClaimCaseQueryDTO;
import com.zatech.cgnci.project.entity.CgnciClaimCaseDO;
import com.zatech.cgnci.project.entity.UserEntity;
import com.zatech.cgnci.project.mapper.CgnciClaimCaseMapper;
import com.zatech.cgnci.project.mapper.CgnciClaimCaseTaskMapper;
import com.zatech.cgnci.project.service.CgnciClaimWorkbenchService;
import com.zatech.cgnci.project.vo.CgnciClaimCasePageWorkbenchVO;
import com.zatech.cgnci.project.vo.CgnciClaimCaseTaskVO;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class CgnciClaimWorkbenchServiceImpl  extends ServiceImpl<CgnciClaimCaseMapper, CgnciClaimCaseDO> implements CgnciClaimWorkbenchService {

    @Resource
    private CgnciClaimCaseTaskMapper cgnciClaimCaseTaskMapper;
    /**
     * 分页查询理赔案件
     */
    @Override
    public IPage<CgnciClaimCasePageWorkbenchVO> page(CgnciClaimCaseQueryDTO queryDTO) {
        return this.baseMapper.pageClaimCaseWorkbench(queryDTO.toPage(), queryDTO);
    }

    /**
     * 根据案件号查询任务流程明细-不包含已注销任务
     * @param caseNo
     * @return List<CgnciClaimCaseTaskVO>
     */
    @Override
    public List<CgnciClaimCaseTaskVO> claimCaseDetail(String caseNo) {
        return cgnciClaimCaseTaskMapper.selectTaskList(caseNo);
    }

}
